package com.jobsleaf.filter.subnetwork.tree;

import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;

import com.jobsleaf.tree.domain.Subnetwork;

class SubnetworkFilter extends ViewerFilter 
{
	private String mSearchString;

	public void setSearchText(String txt) {
		
		mSearchString = txt;
	}
	
	public boolean select(Viewer viewer, Object parentElement, Object element) 
	{
		
		if(element instanceof Subnetwork)
		{
			if(((Subnetwork)element).getName().equalsIgnoreCase(mSearchString))
			{
				return true;
			}
			return false;
		}
		return true;
	}
}